package com.ruoyi.project.system.recommenddetails.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.system.recommenddetails.mapper.RecommendDetailsMapper;
import com.ruoyi.project.system.recommenddetails.domain.RecommendDetails;
import com.ruoyi.project.system.recommenddetails.service.IRecommendDetailsService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 推荐详情Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-05-24
 */
@Service
public class RecommendDetailsServiceImpl implements IRecommendDetailsService 
{
    @Autowired
    private RecommendDetailsMapper recommendDetailsMapper;

    /**
     * 查询推荐详情
     * 
     * @param id 推荐详情ID
     * @return 推荐详情
     */
    @Override
    public RecommendDetails selectRecommendDetailsById(Long id)
    {
        return recommendDetailsMapper.selectRecommendDetailsById(id);
    }

    /**
     * 查询推荐详情列表
     * 
     * @param recommendDetails 推荐详情
     * @return 推荐详情
     */
    @Override
    public List<RecommendDetails> selectRecommendDetailsList(RecommendDetails recommendDetails)
    {
        return recommendDetailsMapper.selectRecommendDetailsList(recommendDetails);
    }

    /**
     * 新增推荐详情
     * 
     * @param recommendDetails 推荐详情
     * @return 结果
     */
    @Override
    public int insertRecommendDetails(RecommendDetails recommendDetails)
    {
        recommendDetails.setCreateTime(DateUtils.getNowDate());
        return recommendDetailsMapper.insertRecommendDetails(recommendDetails);
    }

    /**
     * 修改推荐详情
     * 
     * @param recommendDetails 推荐详情
     * @return 结果
     */
    @Override
    public int updateRecommendDetails(RecommendDetails recommendDetails)
    {
        recommendDetails.setUpdateTime(DateUtils.getNowDate());
        return recommendDetailsMapper.updateRecommendDetails(recommendDetails);
    }

    /**
     * 删除推荐详情对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteRecommendDetailsByIds(String ids)
    {
        return recommendDetailsMapper.deleteRecommendDetailsByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除推荐详情信息
     * 
     * @param id 推荐详情ID
     * @return 结果
     */
    @Override
    public int deleteRecommendDetailsById(Long id)
    {
        return recommendDetailsMapper.deleteRecommendDetailsById(id);
    }
}
